<?php

namespace app\validate\admin;

use think\Validate;

/**
 * 商品验证
 * Class GoodsValidate
 * @package app\validate\admin
 */
class GoodsValidate extends Validate
{

    /**
     * 规则
     * @var string[]
     */
    public $rule = [
        'name' => 'require|length:4,100',
        'classifyId' => 'require|integer',
        'cover' => 'require',
        'price' => 'require',
        'number' => 'require',
        'weight' => 'require',
        'exhibition' => 'require',
        'content' => 'require',
    ];

    /**
     * 提示
     * @var string[]
     */
    public $message = [
        'name.require' => '商品名称不能为空',
        'name.length' => '商品名称长度在4~100个字符之间',
        'classifyId.require' => '请选择商品分类',
        'cover.require' => '请上传商品主图',
        'price.require' => '商品价格不能为空',
        'number.require' => '商品数量不能为空',
        'weight.require' => '商品重量不能为空',
        'exhibition.require' => '请上传商品展示图',
        'content.require' => '商品详情不能为空',
    ];
}